package xyz.zdsoft.homework_manage_module.Controller;


import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import xyz.zdsoft.common.utils.Result;
import xyz.zdsoft.homework_manage_module.Service.TeacherOperationService;
import xyz.zdsoft.homework_manage_module.bo.QueryHomework;
import xyz.zdsoft.homework_manage_module.vo.RestPerTask;


@Api(tags = "教师作业管理审批作业")
@RestController
@RequestMapping("/teacher/Operation")
public class TeacherOperationController {
    @Autowired
    TeacherOperationService service;
    @ApiOperation("已批复和未批复和作业审批")
    @PostMapping("/QueryHomework")
    public Result QueryHomework(@RequestBody QueryHomework queryHomework){

        return service.QueryHomework(queryHomework);
    }
    @ApiOperation("老师批复批复作业")
    @PostMapping("/ApprovalWork")
    public Result ApprovalWork(Integer id,float score,String teacherRemark){
        return service.ApprovalWork(id,score,teacherRemark);
    }
    @ApiOperation("作业任务")
    @PostMapping("/PersonalTask/{id}")
    public  Result<RestPerTask> PersonalTask(@PathVariable Integer id){
        return service.PersonalTask(id);
    }
    @ApiOperation("学生答题")
    @PostMapping("/StudentAnswers/{id}")
    public Result StudentAnswers(@PathVariable Integer id){
        return service.StudentAnswers(id);
    }
    @ApiOperation("老师批复查看批复情况")
    @PostMapping("/ConfirmSubmission/{id}")
    public Result ConfirmSubmission(@PathVariable Integer id){
        return service.ConfirmSubmission(id);
    }

}
